import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Login from '../login'
import Home from '../home';
import Goods from '../home/goods';
import My from '../home/my';
import Bbs from '../home/bbs';
import DocumentDetails from '../home/documentDetails';
import BbsDetails from '../home/bbsDetails';

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld
    },
    {
      path: '/home',
      name: 'Home',
      component: Home,
      children: [
        {
          path: '/home/goods',
          name: 'Goods',
          component: Goods,
        },
        {
          path: '/home/bbs',
          name: 'Bbs',
          component: Bbs,
        },
        {
          path: '/home/my',
          name: 'My',
          component: My,
        },
        {
          path: '/home/goods/:id',
          name: 'DocumentDetails',
          component: DocumentDetails,
        },
        {
          path: '/bbs/bbsDetails/:id',
          name: 'bbsDetails',
          component: BbsDetails,
        }
      ]
    },
    {
      path: '/login',
      name: 'Login',
      component: Login,
    }
  ]
})
